﻿<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified">

	<xsd:element name="bag">
		<xsd:complexType >
			<xsd:choice minOccurs="0" maxOccurs="unbounded" >
				<xsd:element name="item" type="itemType" />
			</xsd:choice>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="itemType" >
		<xsd:choice minOccurs="0" maxOccurs ="unbounded" >
			<xsd:element name="property" type="propertyType" />
		</xsd:choice>
		<xsd:attribute name="key" type="xsd:normalizedString" use="required" />
	</xsd:complexType>

	<xsd:complexType name="propertyType" >
		<xsd:attribute name="name" type="identityName" use="required" />
		<xsd:attribute name="value" type="xsd:string" use="optional" />
		<xsd:attribute name="type" type="itemTypeType" use="optional" default="string" />
	</xsd:complexType>

	<xsd:simpleType name="identityName" >
		<xsd:restriction base="xsd:normalizedString" >
			<xsd:minLength value="1" />
			<xsd:pattern value="[\w_]+" />
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="itemTypeType" >
		<xsd:restriction base="xsd:normalizedString" >
			<xsd:enumeration value="string" />
			<xsd:enumeration value="int" />
			<xsd:enumeration value="integer" />
			<xsd:enumeration value="short" />
			<xsd:enumeration value="long" />
			<xsd:enumeration value="money" />
			<xsd:enumeration value="decimal" />
			<xsd:enumeration value="currency" />
			<xsd:enumeration value="datetime" />
			<xsd:enumeration value="date" />
			<xsd:enumeration value="float" />
			<xsd:enumeration value="double" />
			<xsd:enumeration value="bit" />
			<xsd:enumeration value="bool" />
			<xsd:enumeration value="boolean" />
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>
